#include "bits/stdc++.h"
using namespace std;
using ll = long long;
const int N = 1010; //100005

struct people
{
	int num;
	int timex;
};

bool cmp(people x,people y)
{
	return x.timex<y.timex;
}

people arr[N];
int n;
double sum,aver;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	cin >> n;
	for(int i=1;i<=n;i++)
	{
		cin >> arr[i].timex;
		arr[i].num = i;
	}
	sort(arr+1,arr+1+n,cmp);
	
	for(int i=1;i<=n;i++)
	{
		cout << arr[i].num << " ";
		sum += arr[i].timex * (n-i);
	}
	aver = sum/n;
	cout << endl << fixed << setprecision(2) << aver;
	return 0;
}
